package arraylist;

public class Test {
    public static void main(String[] args) {
        IList iList=new MyArrayList();//MyArrayList继承自IList,接口不能实例化,但是类可以

        MyArrayList myArrayList=new MyArrayList();

//        iList.add(1);
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);

        //测试add(pos,data)
        /*myArrayList.add(0,100);
        myArrayList.add(1,100);
        myArrayList.add(5,100);
        myArrayList.add(7,100);*/

        System.out.println(myArrayList.contains(100));

        //测试get(pos)
        /*System.out.println(myArrayList.get(0));
        System.out.println(myArrayList.get(1));
        System.out.println(myArrayList.get(3));*/

        myArrayList.display();

        myArrayList.remove(1);
        myArrayList.display();
        myArrayList.remove(2);
        myArrayList.display();
        myArrayList.remove(3);
        myArrayList.display();

    }

}
